From: Marco Trevisan (TreviƱo) Date: Mon, 2 Sep 2019 23:51:00 +0000 (+0200) Subject: screenshot: Pass a Graphene.Point as PickPixel 'finished' signal X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~781^2^2~527 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f67b409fc11a8f60de98fdf733e66439b8d76412;p=gnome-shell.git screenshot: Pass a Graphene.Point as PickPixel 'finished' signal This will allow to pass the data as native object when porting this to Clutter actor. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/559 --- diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js index bbc1be499..f3d1d02dd 100644 --- a/js/ui/screenshot.js +++ b/js/ui/screenshot.js @@ -1,7 +1,7 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- /* exported ScreenshotService */ -const { Clutter, Gio, GLib, Meta, Shell, St } = imports.gi; +const { Clutter, Graphene, Gio, GLib, Meta, Shell, St } = imports.gi; const Signals = imports.signals; const GrabHelper = imports.ui.grabHelper; @@ -198,7 +198,7 @@ var ScreenshotService = class { let screenshot = this._createScreenshot(invocation, false); if (!screenshot) return; - screenshot.pick_color(...coords, (o, res) => { + screenshot.pick_color(coords.x, coords.y, (_o, res) => { let [success_, color] = screenshot.pick_color_finish(res); let { red, green, blue } = color; let retval = GLib.Variant.new('(a{sv})', [{ @@ -349,7 +349,8 @@ var PickPixel = class { } _onButtonRelease(actor, event) { - this._result = event.get_coords(); + let [x, y] = event.get_coords(); + this._result = new Graphene.Point({ x, y }); this._grabHelper.ungrab(); return Clutter.EVENT_PROPAGATE; }